<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
  
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">司机信息管理</li>
      
      <a href="javascript:window.history.back();" class="pull-right" style="margin-right: 5px;">
        <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;返回
      </a>
    </ol>
  
    <div class="ms-content-layout">
  
      <div class="row">
  
        <div class="col-xs-12">
          <div class="form-horizontal ms-form form-personal-info">
  
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-3 ">所属公司：</label>
              <div class="col-xs-3 pull-left">
                <p class="form-control-static">${driver.supplier.name}</p>
              </div>
  
              <label class="control-label col-xs-2">审核状态：</label>
              <div class="col-xs-4 pull-left">
                <p class="form-control-static">${driver.status.description}</p>
              </div>
            </div>
  
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-3">是否激活（司机管家）：</label>
              <div class="col-xs-3 pull-left">
                <p class="form-control-static">${driver.appState ? '是' : '否'}</p>
              </div>
              
              
            </div>
            
          </div>
        </div>
  
      </div>
  
      <div class="block-heading">
        <h5>司机基本信息</h5>
        <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !currentPrincipal.branch and !driver.status.audit}">
          <a href="${ctx.host}/drivers/${driver.id}/edit-basic" data-target="#edit-basic" data-toggle="modal" title="edit"
             class="pull-right" style="font-size: 12px; padding-top: 20px;">编辑
          </a>
        </c:if>
      </div>
  
      <div class="form-horizontal ms-form form-personal-info form-supplier-info">
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">1&nbsp;<span class="color-red">*</span>姓名：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.name}</p>
          </div>
  
          <label class="control-label col-xs-2 ">2&nbsp;<span class="color-red">*</span>性别：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.gender ? '' : persist.masterData('SEX', driver.gender)}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">3&nbsp;<span class="color-red">*</span>身份证：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.citizenCode}</p>
          </div>
  
          <label class="control-label col-xs-2 ">4&nbsp;<span class="color-red">*</span>出生日期：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate value="${driver.birthday}" pattern="yyyy-MM-dd"/></p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">5&nbsp;<span class="color-red">*</span>手机号：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.mp}</p>
          </div>
  
          <label class="control-label col-xs-2 ">6&nbsp;<span class="color-red">*</span>工号：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.code}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3">7.1&nbsp;<span class="color-red">*</span>现任职务：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.dutyId ? '' : persist.masterData('TRUCK_POSITION', driver.dutyId)}</p>
          </div>
          
          <label class="control-label col-xs-2">7.2&nbsp;<c:if test="${(not driver.status.editing) or (not driver.status.rejected)}"><span class="color-red">*</span></c:if>所属驳运车：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.vehicleId ? '' : persist.vehicle(driver.vehicleId).code.concat(' - ').concat(persist.vehicle(driver.vehicleId).name)}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">8&nbsp;<span class="color-red">*</span>劳务合同签署方：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">
              <c:if test="${driver.contractParty eq '01'}">公司</c:if>
              <c:if test="${driver.contractParty eq '02'}">中介</c:if>
            </p>
          </div>
  
          <label class="control-label col-xs-2 ">9&nbsp;<span class="color-red">*</span>准驾车型：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">
              <c:choose>
                <c:when test="${driver.drivingType eq '01'}">A1</c:when>
                <c:when test="${driver.drivingType eq '02'}">A2</c:when>
                <c:when test="${driver.drivingType eq '03'}">B2</c:when>
                <c:when test="${driver.drivingType eq '04'}">B1</c:when>
                <c:when test="${driver.drivingType eq '05'}">C1</c:when>
              </c:choose>
            </p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3">10&nbsp;<span class="color-red">*</span>驾龄：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.drivingAge}</p>
          </div>
          
          <label class="control-label col-xs-2">是否激活（FMS）：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.active ? '是' : '否'}</p>
          </div>
        </div>
  
      </div>

  
      <div class="block-heading">
        <h5>司机证件信息</h5>
      </div>
  
      <div class="form-horizontal ms-form form-personal-info form-supplier-info">
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">11&nbsp;<span class="color-red">*</span>身份证正面：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
              <c:when test="${not empty driver.idFrontPhoto}">
                <p class="form-control-static">
                  <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${driver.idFrontPhoto}">查看图片</a>
                  <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !driver.status.audit}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=idFrontPhoto&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                  </c:if>
                </p>
              </c:when>
              <c:otherwise>
                <c:if test="${driverMenuType == 'qualified' or driver.status.audit}">
                  <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                </c:if>
                <c:if test="${driverMenuType != 'qualified' and !driver.status.audit}">
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=idFrontPhoto&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">上传身份证正面</a>
                </c:if>
              </c:otherwise>
            </c:choose>
          </div>
            
          <label class="control-label col-xs-2 ">12&nbsp;<span class="color-red">*</span>身份证背面：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
              <c:when test="${not empty driver.idBackPhoto}">
                  <p class="form-control-static">
                    <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${driver.idBackPhoto}">查看图片</a>
                    <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !driver.status.audit}">
                      <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=idBackPhoto&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                    </c:if>
                  </p>
               </c:when>
               <c:otherwise>
                 <c:if test="${driverMenuType == 'qualified' or driver.status.audit}">
                   <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                 </c:if>
                 <c:if test="${driverMenuType != 'qualified' and !driver.status.audit}">  
                   <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=idBackPhoto&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">上传身份证背面</a>
                 </c:if>
               </c:otherwise>
            </c:choose>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">13&nbsp;<span class="color-red">*</span>驾照原件：</label>
          <div class="col-xs-3 pull-left upload-cover">
          <c:choose>
            <c:when test="${not empty driver.license}">
               <p class="form-control-static">
                 <a data-imgsrc="${driver.license}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                 <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !driver.status.audit}">
                   <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=license&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                 </c:if>
               </p>
            </c:when>
            <c:otherwise>
              <c:if test="${driverMenuType == 'qualified' or driver.status.audit}">
                <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
              </c:if>
              <c:if test="${driverMenuType != 'qualified' and !driver.status.audit}">
                <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=license&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">上传驾照原件</a>
              </c:if>
            </c:otherwise>
            </c:choose>
          </div>
  
          <label class="control-label col-xs-2 ">14&nbsp;<span class="color-red">*</span>驾照副本扫描件：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
              <c:when test="${not empty driver.licenseBack}">
               <p class="form-control-static">
                 <a data-imgsrc="${driver.licenseBack}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                 <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !driver.status.audit}">
                   <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=licenseBack&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                 </c:if>
               </p>
              </c:when>
              <c:otherwise>
                <c:if test="${driverMenuType == 'qualified' or driver.status.audit}">
                  <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                </c:if>
                <c:if test="${driverMenuType != 'qualified' and !driver.status.audit}">
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=licenseBack&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">上传驾照复印件</a>
                </c:if>
              </c:otherwise>
            </c:choose>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">15&nbsp;第三方验证：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
              <c:when test="${not empty driver.thirdAuthentication}">
               <p class="form-control-static">
                 <a data-imgsrc="${driver.thirdAuthentication}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                 <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !driver.status.audit}">
                   <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=thirdAuthentication&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                 </c:if>
               </p>
              </c:when>
              <c:otherwise>
                <c:if test="${driverMenuType == 'qualified' or driver.status.audit}">
                 <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                </c:if>
                <c:if test="${driverMenuType != 'qualified' and !driver.status.audit}">
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=thirdAuthentication&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">上传第三方验证</a>
                </c:if>
              </c:otherwise>
            </c:choose>
          </div>
          
        
          <label class="control-label col-xs-2 ">16&nbsp;正面免冠照：</label>
          <div class="col-xs-3 pull-left upload-cover">
            <c:choose>
             <c:when test="${not empty driver.avatar}">
               <p class="form-control-static">
                 <a data-imgsrc="${driver.avatar}" href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up">查看图片</a>
                 <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !driver.status.audit}">
                   <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=avatar&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                 </c:if>
               </p>
             </c:when>
             <c:otherwise>
               <c:if test="${driverMenuType == 'qualified' or driver.status.audit}">
                 <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
               </c:if>
               <c:if test="${driverMenuType != 'qualified' and !driver.status.audit}">
                 <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/drivers/${driver.id}/cover?type=avatar&driverMenuType=${driverMenuType}&fileObject=Driver&objectId=${driver.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">上传正面照</a>
               </c:if>
             </c:otherwise>
           </c:choose>
          </div>
        </div>
  
      </div>
  
      <div class="block-heading">
        <h5>司机个人信息</h5>
        <c:if test="${driverMenuType != 'sub' and driverMenuType != 'qualified' and !currentPrincipal.branch and !driver.status.audit}">
          <a href="${ctx.host}/drivers/${driver.id}/edit-profile" data-target="#edit-profile" data-toggle="modal" title="edit"
           class="pull-right" style="font-size: 12px; padding-top: 20px;">编辑
          </a>
        </c:if>
      </div>
  
      <div class="form-horizontal ms-form form-personal-info form-supplier-info">
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">17&nbsp;文化程度：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.educationLevel ? '':persist.masterData('EDUCATION', driver.educationLevel)}</p>
          </div>
  
          <label class="control-label col-xs-2 ">18&nbsp;政治面貌：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.clanId ? '':persist.masterData('PARTY', driver.clanId)}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">19&nbsp;专业：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.speciality}</p>
          </div>
  
          <label class="control-label col-xs-2 ">20&nbsp;何时加入：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate value="${driver.joinDate}" pattern="yyyy-MM-dd"/></p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">21&nbsp;毕业学校：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.school}</p>
          </div>
  
          <label class="control-label col-xs-2 ">22&nbsp;学位：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.degreeId ? '':persist.masterData('DEGREE', driver.degreeId)}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">23&nbsp;毕业年月：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static"><fmt:formatDate value="${driver.graduateDate}" pattern="yyyy-MM-dd"/></p>
          </div>
  
          <label class="control-label col-xs-2 ">24&nbsp;家庭地址：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.homeAddress}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">25&nbsp;家庭邮编：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.homeZipcode}</p>
          </div>
  
          <label class="control-label col-xs-2 ">26&nbsp;联系地址：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.contactAddress}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">27&nbsp;联系邮编：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.contactZipcode}</p>
          </div>
  
          <label class="control-label col-xs-2 ">28&nbsp;联系人姓名：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.contactorName}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">29&nbsp;称谓：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.contactorAppellation}</p>
          </div>
  
          <label class="control-label col-xs-2 ">30&nbsp;固定电话：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.tel}</p>
          </div>
        </div>
  
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">31&nbsp;备注：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.description}</p>
          </div>
        </div>
  
      </div>
      
      <div class="block-heading">
        <h5>大通黑白名单记录</h5>
      </div>
  
      <div class="form-horizontal ms-form form-personal-info form-supplier-info">
      
       <div class="form-group ms-form-group">
          <label class="control-label col-xs-3">是否是黑名单：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${empty driver.black ? '' : driver.black ? '是' :  '否'}</p>
          </div>
          <label class="control-label col-xs-2">能级得分：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${driver.score}</p>
          </div>
      </div>
      
        <table class="table table-hover ms-table">
	        <thead>
	          <tr>
	            <th>序号</th>
	            <th>是否黑名单</th>
	            <th>处理人</th>
	            <th>处理原因</th>
	            <th>处理时间</th>
	          </tr>
	        </thead>
	
	        <tbody>
	          <c:forEach items="${esbBlackWhiteLists}" var="blackWhiteList" varStatus="status">
	            <tr>
	              <td>${status.index + 1}</td>
                  <td>${blackWhiteList.black ? '是'  :  '否 '  }</td>
                  <td>${blackWhiteList.dealPerson}</td>
                  <td>${blackWhiteList.dealReason}</td>
                  <td><fmt:formatDate value="${blackWhiteList.dealTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	            </tr>
	          </c:forEach>
	        </tbody>
        </table>
      </div>
      
    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/driver/driver-view.js"/>
  <script type="text/javascript">
    require(['page/supplier/management/driver/driver-view'], function (page) {
      page.init({
        'code': '${driver.code}',
        'citizenCode': '${not empty driver.citizenCode ? driver.citizenCode.toUpperCase() : ""}',
        'mobile': '${driver.mp}'
      })
    })
  </script>

</body>
</html>